from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *


def init_func():
    # select clearing color 	
    glClearColor(0.0, 0.0, 0.0, 0.0)
    print "II"

def reshape_func(width,height):
    glViewport(0, 0, width, height)
    glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    print "R"


def display_func(wigth,heigth):
    # clear all pixels 
    glClear(GL_COLOR_BUFFER_BIT)

    # draw white polygon (rectangle) with corners at
    # (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)  
    glColor3f(1.0, 1.0, 1.0)
    glBegin(GL_POLYGON)
    glVertex3f(0.25, 0.25, 0.0)
    glVertex3f(0.75, 0.25, 0.0)
    glVertex3f(0.75, 0.75, 0.0)
    glVertex3f(0.25, 0.75, 0.0)
    glEnd()

    # don't wait!  
    # start processing buffered OpenGL routines 
    glFlush ();
    print "DD"


INIT = init_func
DISPLAY = display_func
RESHAPE = reshape_func
